Skip to content

Conversation

@kubamracek
Copy link
Contributor

Given that we support named function references, closures with no-captures are no different from that. Adding this mainly to be able to support macro-generated metadata, e.g. for Swift Testing.

@kubamracek
Copy link
Contributor Author

@swift-ci please test

@kubamracek
Copy link
Contributor Author

@swift-ci please test Windows platform

// Closures are allowed if they have no captures
if (auto closureExpr = dyn_cast<ClosureExpr>(expr)) {
TypeChecker::computeCaptures(const_cast<ClosureExpr *>(closureExpr));
if (!closureExpr->getCaptureInfo().isTrivial()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, that came out nicer than expected.

@kubamracek
Copy link
Contributor Author

@swift-ci please test Windows platform

@kubamracek kubamracek enabled auto-merge November 18, 2025 00:57
@kubamracek kubamracek merged commit 5f578ad into swiftlang:main Nov 18, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants